<?PHP
//default values

$e['status']='enabled';
$e['start']=date("Y-m-d h:i:s");
$e['end'] = mktime(0, 0, 0, date("m")+12,   date("d"),   date("Y"));
$e['end']=date("Y-m-d h:i:s",$e['end']);
$e['weight']=0;
$e['access_currency']='USD';
$e['access_cost']=0;
$e['access_expiry']=48;
$e['delivery']='vod';
$e['buffer']=30;
$e['owner']=$_SESSION['user_id'];						
$e['resize_image']='0';
$e['index']=false;
$e['playlist']=0;
//pre-run
$content_type=new content_type;
$content_category=new content_category;
rp ($content_category->data);
$table='content';
$id='id';
$catch='title';
include 'm/content/p_content.php';
//get video content
$content_category->where['type']='video';
$content_category->get_category();
$video_category=$content_category->data;
if(!empty($e['type']))
{
	$type = $e['type'];
}
else if(!empty($_GET['type']))
{
	$type=$_GET['type'];
}
else if (!empty($_POST['type']))
{
	$type=$_POST['type'];
}
else
{
	$type='page';
}

$e['type']=	$type;
$content_category->where['type']=$type;
$content_category->get_category();

if(!empty($content_category->data))
{
	$content_category->data=array_merge($content_category->data,$video_category);	
}
else
{
	$content_category->data=$video_category;	
}

if($type=='gallery')
{
	$gallery_category=new content_category;
	$gallery_category->where['type']='post';
	$gallery_category->get_category();
	$gallery_category2=$gallery_category->data;
	
	$content_category->data=array_merge($content_category->data,$gallery_category2);
}

// print headers
$content_msg='Content Type: '.$type.'<br />';
$content_msg.='Action: '.$_GET['cmd'].'<br />';

$music=new music;
$music->get_playlist();

?>